﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace EFModel.Migrations
{
    public partial class lp2 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_major_change_config_file_second_kind_new_second_kind_id",
                table: "major_change");

            migrationBuilder.DropIndex(
                name: "IX_major_change_new_second_kind_id",
                table: "major_change");

            migrationBuilder.AddColumn<int>(
                name: "config_file_second_kindfsk_id",
                table: "major_change",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_major_change_config_file_second_kindfsk_id",
                table: "major_change",
                column: "config_file_second_kindfsk_id");

            migrationBuilder.AddForeignKey(
                name: "FK_major_change_config_file_second_kind_config_file_second_kindfsk_id",
                table: "major_change",
                column: "config_file_second_kindfsk_id",
                principalTable: "config_file_second_kind",
                principalColumn: "fsk_id",
                onDelete: ReferentialAction.Restrict);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_major_change_config_file_second_kind_config_file_second_kindfsk_id",
                table: "major_change");

            migrationBuilder.DropIndex(
                name: "IX_major_change_config_file_second_kindfsk_id",
                table: "major_change");

            migrationBuilder.DropColumn(
                name: "config_file_second_kindfsk_id",
                table: "major_change");

            migrationBuilder.CreateIndex(
                name: "IX_major_change_new_second_kind_id",
                table: "major_change",
                column: "new_second_kind_id");

            migrationBuilder.AddForeignKey(
                name: "FK_major_change_config_file_second_kind_new_second_kind_id",
                table: "major_change",
                column: "new_second_kind_id",
                principalTable: "config_file_second_kind",
                principalColumn: "fsk_id",
                onDelete: ReferentialAction.Restrict);
        }
    }
}
